<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/11/6/006
 * Time: 下午 3:48
 */
namespace app\service;

use think\Cache;

class MobileCacheService
{
    /**
     * 清除手机端缓存
     * @param $key  手机端Redis对应的key
     */
    public function delMobileRedisCache($key)
    {
        //连接手机端Redis库
        $options = [
            'host' => '127.0.0.1',
            'port' => 6379,
            'select' => config('mobile_cache_config.select'),
            'prefix' => config('mobile_cache_config.prefix'),
            'type'   => config('cache.type')
        ];
        $cache = Cache::connect($options);

        $cache->rm($key);
    }
}